package com.example.mytest.DAO;

import com.example.mytest.Entity.DeviceOnlineRecordEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by Studio on 2017/5/18.
 */
@Repository

public interface DeviceOnlineRecordDAO extends JpaRepository<DeviceOnlineRecordEntity,Integer> {

    @Query(value = "insert into device_online_record(id,device_id,created,online) values(?,?,?,?)",nativeQuery = true)
    @Modifying
    @Transactional
    public int insertOnline(String id,String device_id,String created , int online);

}
